﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FlickrNet;

/// <summary>
/// Summary description for FlickrHelper
/// </summary>
public class FlickrHelper
{
    const string key = "2b620817bd11344b8060308396d61d35";
    const string secret = "30a2737f711b7534";

    public static Photos GetPhotosByKeyword(string Keyword)
    {
        Flickr.CacheDisabled = true;
        PhotoSearchOptions options = new PhotoSearchOptions();
        options.PerPage = 10;
        options.Extras |= PhotoSearchExtras.License;
        options.Page = 0;
        options.AddLicense(1);
        options.AddLicense(5);
        options.AddLicense(7);
        options.PrivacyFilter = PrivacyFilter.PublicPhotos;
        options.SortOrder = PhotoSearchSortOrder.Relevance;        
        options.Text = Keyword;
        // options.BoundaryBox = BoundaryBox.Canada;
        FlickrNet.Flickr flickr = new Flickr(key, secret);
        Photos photos = flickr.PhotosSearch(options);
        return photos;
    }



}
